<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="{{$img_url}}index.css" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="{{$js_url}}function.js"></script>
<div id="mainer">
  <table class="table1" width="100%">
    <tr> 
      <td align="left">{{$headline}}</td>
    </tr>
  </table>
<script language=JavaScript>
function CheckMem(theForm)
{
  if (theForm.Madmin.value == "")
  {
    alert("请正确填写用户名称！");
    theForm.Madmin.focus();
    return (false);
  }
  if (theForm.Mpassword.value != theForm.Mpassword2.value)
  {
    alert("前后两次输入的密码不匹配！");
    theForm.Mpassword2.focus();
    return (false);
  }

  if (theForm.Mrealname.value == "")
  {
    alert("请正确填写用户真实姓名！");
    theForm.Mrealname.focus();
    return (false);
  }
  return (true);
}
</script>
  <table width="100%" border="0" align="center" class="table1">
    <form action="" method=post name=adduser onSubmit="return CheckMem(this)">
	{{if $Madminid>0}}<input type="hidden" name="CgMadminid" value="{{$Madminid}}" />{{/if}}
      <tr> 
        <td height="0" valign="top" bgcolor="#FFFFFF"> 
          <table width="100%" border=0 bordercolordark=#ffffff bordercolochight=#999999 cellpadding=5 cellspacing=0 bordercolor="#DDE3EC">
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td width="22%" height="0">用 户 名</td>
              <td height="0"> <input name=Madmin id=Madmin type=text class="to" value="{{$Madmin}}" size=12 maxlength=12> 
                <font color="#FF0000">*</font></td>
            </tr>
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td height="0">密&nbsp; &nbsp;&nbsp;码</td>
              <td height="0"> <input name=Mpassword id=Mpassword type=password class="to" value="" size=12 maxlength=40> 
                <font color="#FF0000">*</font> {{if $Madminid>0}}不修改请留空。{{/if}}</td>
            </tr>
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td height="0">确认密码</td>
              <td height="0"> <input name=Mpassword2 id=Mpassword2 type=password class="to" value="" size=12 maxlength=40> 
                <font color="#FF0000">*</font> {{if $Madminid>0}}不修改请留空。{{/if}}</td>
            </tr>
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td height="0">到期时间</td>
              <td height="0"> <input name=Mexpdate type=text class="to" value="{{if $Madminid>0}}{{$Mexpdate}}{{else}}{{$updatedate}}{{/if}}" size=12 maxlength=10> 
                <font color="#FF0000">*</font></td>
            </tr>
			<SCRIPT LANGUAGE='JavaScript'>
			var lastCheck = null;
			function checkIt( e )
			{
				if (document.adduser.Mflevel[0].checked == true) {
					mainrank.style.display = 'none';
				}else{
					mainrank.style.display = '';
				}
				if (document.adduser.Mflevel[1].checked == true) {
					mainrank.style.display = '';	
				}
				else{
					mainrank.style.display = 'none';
				}
			}	
			</SCRIPT>
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td height="0">用户类型</td>
              <td height="0"><input type='radio' name='Mflevel' value='1' onclick='checkIt(this)' {{if $Mflevel<2}}checked{{/if}}>
                超级管理员&nbsp;
                <input type='radio' name='Mflevel' value='2' onclick='checkIt(this)' {{if $Mflevel>1}}checked{{/if}} >
                普通管理员&nbsp;&nbsp;<font color="#FF0000">*</font></td>
            </tr>
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td height="0">性别</td>
              <td height="0"> <input type=radio name=Mgender value="男" {{if $Mgender=="男"}}checked{{/if}}>
                先生&nbsp; <input type=radio name=Mgender value="女" {{if $Mgender=="女"}}checked{{/if}}>
                女士&nbsp;&nbsp;</td>
            </tr>
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td height="0">真实姓名</td>
              <td height="0"> <input name=Mrealname type=text size=15 maxlength=12 value="{{$Mrealname}}"> 
                <font color="#FF0000">*</font></td>
            </tr>
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td height="0">联系方式</td>
              <td height="0"> <input name=Mconactinfo type=text size=40 maxlength=20 value="{{$Mconactinfo}}"></td>
            </tr>
            <tr bgcolor="#FFFFFF" class="p9"> 
              <td>说明备注</td>
              <td> <textarea name=Mcontent cols=40 rows=5 id="Mcontent">{{$Mcontent}}</textarea></td>
            </tr>
          </table>
          <br>
          <table width="100%" border="0" cellspacing="0" cellpadding="0" id=mainrank style="display:'{{if $Mflevel<2}}none{{/if}}'">
            <tr> 
              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr class="head"> 
                    <td height="27"> 
                      <div align="left">请选择管理用户操作权限</div></td>
                  </tr>
                </table>
                <table width="96%" border="0" align="center" cellpadding="2" cellspacing="2">
				<tr> 
                 <td>
				{{section name=a loop=$sidebarmenu}}
                  &nbsp;{{$sidebarmenu[a].linkname}}<br>
					{{section name=b loop=$sidebarmenu[a].n}}
					&nbsp; 
					<input type=checkbox name=Mcompetence[] value="{{$sidebarmenu[a].n[b].limit}}" 
					{{section name=c loop=$userMcompetence}}{{if $userMcompetence[c]==$sidebarmenu[a].n[b].limit}} checked{{/if}}
					{{/section}}>{{$sidebarmenu[a].n[b].linkname}}
					{{/section}}
					<hr>
				{{/section}}
				</td></tr>
                </table></td>
            </tr>
          </table>
          <table width="100%" border="0" cellspacing="5" cellpadding="5">
            <tr> 
              <td height="45"> <div align="center"> 
                  <input name=adduser type=submit id="adduser" value=" {{if $Madminid>0}}编辑{{else}}添加{{/if}}此用户 ">
                  &nbsp; 
                  <input type=reset name=b value=" 清 除 " onclick="self.history.back();">
                </div></td>
            </tr>
          </table>
        </td>
      </tr>
    </form>
  </table>
{{include file="footer.html"}}
</div>